<template>
	<div class="tui-grid">
		<div class="tui-item" v-for="(item,index) in value.imgList" :key="index">
			<div @tap="handleAction(item)" class="flex flex-col align-center justify-center">
				<view class="tui-grid-icon">
					<img :src="item.img.imgUrl" class="grid-img" />
				</view>
				<text class="tui-grid-label">{{item.name}}</text>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: "m-category-list",
		props: {
			value: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		data() {
			return {
				dataList: []
			};
		},
		computed: {},
		watch: {
			item(val) {
				this.$forceUpdate();
			},
		},
		created() {},
		methods: {
			handleAction(item) {
				uni.navigateTo({
					url: item.imgLink
				})
			},
		}
	}
</script>

<style scoped>
	.grid-img {
		width: 100rpx;
		height: 100rpx;
	}

	.tui-grid {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.tui-item {
		width: 180rpx;
	}

	.tui-grid-label {
		white-space: pre-wrap;
		border: 0px solid black;
		position: relative;
		box-sizing: border-box;
		display: block;
		-webkit-box-orient: vertical;
		flex-direction: column;
		align-content: flex-start;
		flex-shrink: 0;
		font-size: 26rpx;
		text-align: center;
		align-self: center;
		color: rgb(0, 0, 0);
	}
</style>
